package demo2;

public class SingleTonLazy {
    private static volatile SingleTonLazy instance = null;

    private SingleTonLazy() {
    }
    //DCL
    public static SingleTonLazy getInstance() {
        if (instance == null) {
            synchronized (SingleTonLazy.class) {
                if (instance == null) {
                    instance = new SingleTonLazy();
                }
            }
        }
        return instance;
    }
}
